Skip to content

fix(result): look up Output names as own keys only - #428

Open
rudycelekli wants to merge 1 commit into
hypit-ai:mainfrom
rudycelekli:fix/result-own-output-names
Open

rudycelekli wants to merge 1 commit into
hypit-ai:mainfrom
rudycelekli:fix/result-own-output-names

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 19, 2026 •

Copy link
Copy Markdown

Build Result Output lookups index manifest.outputs[name] directly, so names inherited from Object.prototype count as Outputs:

hypit result edit <build> --highlight constructor   -> accepted; "constructor" is written into result.json
hypit get <build> --output toString                  -> TypeError: Cannot read properties of undefined (reading 'kind')
hypit inspect <build> --output hasOwnProperty        -> same TypeError
hypit history valueOf                                -> same TypeError

The name comes straight from the command line. toString returns a function rather than undefined, so the "no such Output" branch is skipped and the code reads .value.kind from the function. The presentation update in the same file already guards display names with Object.hasOwn(manifest.outputs, name). The other lookups did not.

Every Output lookup now goes through Object.hasOwn, as outputDisplayNames already does:

  • highlight validation in updatePresentation;
  • the two forwarding resolvers in store.ts, and the forwarding walk that follows build-output links;
  • result-export and the history query in the CLI.

A name that is not an own Output now gets the existing "has no Output" error or an undefined result.

The result test now checks that highlighting constructor is rejected and that resolving toString returns undefined. It fails on main and passes with the change. This is input hardening; ordinary Output names behave exactly as before.

Checks run:

  • node --import tsx --test packages/result/test/*.test.ts packages/cli/test/build-results.test.ts (25 passed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant